export function formatConversationCardMessage(messageItem) {
  let content = messageItem.content;
  let contentType = getConversationCardContentType(messageItem);
  content = getContent(content, contentType, messageItem);
  return content;
}
export function getConversationCardContentType(messageItem) {
  return messageItem.contentType || 110;
}
function getContent(c, cType, latestMsg) {
  let content = c;
  switch (cType) {
    case 101: //文字
      break;
    case 102:
      content = "[图片]";
      break;
    case 103:
      content = "[语音]";
      break;
    case 104:
      content = "[视频]";
      break;
    case 105:
      content = "[文件]";
      break;
    case 106:
      content = JSON.parse(content).text;
      break;
    case 107: //合并消息
      content = JSON.parse(content).title;
      break;
    case 108:
      content = "[名片]";
      break;
    case 109:
      content = "[位置]";
      break;
    case 110:
      content = "[新消息]";
      break;
    case 111:
      content = latestMsg.senderNickname + "撤回了一条消息";
      break;
    case 114:
      content = JSON.parse(content).text;
      break;
    case 115:
      content = "[语音通话]";
      break;
    case 118:
      content = latestMsg.senderNickname + "撤回了一条消息";
      break;
    case 1204:
      content = `你们已经是好友啦,开始聊天吧~`;
      break;
    default:
      try {
        let c2 = JSON.parse(content);
        console.log(c2, cType);
      } catch (error) {
        console.log(error);
      }
      // let c3 = JSON.parse(c2.jsonDetail);
      // console.log(cType, c2.defaultTips, c3);
      content = "[暂未支持的消息类型]";
      break;
  }
  return content;
}